{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <!--搜索框开始-->
                <div class="col-sm-12">
                    <div class="layui-form layui-form-item">

                        <div class="layui-col-md6 layui-input-inline">
                            <input type="text" id="dis_name" class="layui-input search" name="dis_name" value="" placeholder="小区名称"/>
                        </div>

                        <div class="layui-col-md6 layui-input-inline">
                            <input type="text" id="dis_kaifa" class="layui-input search" name="dis_kaifa" value="" placeholder="开发商"/>
                        </div>
                        <div class="layui-col-md6 layui-input-inline">
                            <select name="sheng" lay-search="" id="province"  lay-filter="province">
                                <option value="">---- 请选择省 ----</option>
                                {foreach name="province" item="v1"}
                                <option value="{$v1.district_id}" >{$v1.district}</option>
                                {/foreach}
                            </select>
                        </div>

                        <div class="layui-col-md6 layui-input-inline">
                            <select name="shi" lay-search=""  id="city"  lay-filter="city">
                                <option value="">---- 请选择市 ----</option>
                            </select>
                        </div>

                        <div class="layui-col-md6 layui-input-inline">
                            <select name="qu" lay-search=""  id="district"  lay-filter="district">
                                <option value="">---- 请选择区 ----</option>
                            </select>
                        </div>
                        <div class="layui-input-inline">
                            <button class="layui-btn" lay-submit="" lay-filter="LAY-search">立即搜索</button>
                            <button  class="layui-btn layui-btn-normal" id="empty"  lay-submit="" lay-filter="LAY-search">重置</button>
                        </div>
                    </div>
                </div>
                <!--搜索框结束-->
                <!--操作框开始-->
                <div class="col-sm-12">
                <div class="input-group" >
                <button class="btn btn-primary" type="button" onclick="wk.href('{:url('disAdd')}');">
                <i class="fa fa-plus"></i> 添加小区
                </button>
                </div>
                </div>
                <!--操作框结束-->
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>
                    <!--图片模板-->

                    <!--类型模板-->

                    <!--操作模板-->
                    <script type="text/html" id="opeBar">
                        <a href="javascript:;" onclick="wk.layer_show('详情','{:url('disDetail')}?dis_id={{d.dis_id}}')" class="btn btn-primary btn-xs m-r-xs" title="详情"><i class="fa fa-search"></i></a>
                        <a href="javascript:;" onclick="wk.href('{:url('disEdit')}?dis_id={{d.dis_id}}')" class="btn btn-primary btn-xs m-r-xs" title="编辑"><i class="fa fa-pencil"></i></a>
                        <a href="javascript:;" onclick="wk.confirm('{{d.dis_id}}','{:url('disDel')}')" class="btn btn-danger btn-xs m-r-xs" title="删除"><i class="fa fa-trash-o"></i></a>
                        <a href="javascript:;" onclick="wk.layer_show('户型图','{:url('disImage')}?dis_id={{d.dis_id}}')" class="btn btn-primary btn-xs m-r-xs" title="户型图"><i class="fa fa-file-photo-o"></i></a>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
                , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("District/index")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
                  {type:'numbers', width: 60, title: '序号', align: 'center'}
                , {field:'dis_name', width: '', title: '小区名称', align: 'center'}
                , {field: 'dis_kaifa', width: '', title: '开发商', align: 'center'}
                , {field: 'dis_wuyecom', width: '', title: '物业', align: 'center'}
                , {field: 'dis_loudong', width: 80, title: '楼栋数', align: 'center'}
                , {field: 'dis_mianji', width: 90, title: '总面积', align: 'center'}
                , {field: 'dis_price', width: 90, title: '均价', align: 'center'}
                , {field: 'sheng', width: '80', title: '省', align: 'center'}
                , {field: 'shi', width: '80', title: '市', align: 'center'}
                , {field: 'qu', width: '80', title: '区', align: 'center'}
                , {field: 'dis_time', width: 160, title: '添加时间', align: 'center'}
                , {fixed: 'right', width: 160, title: '操作', align: 'center', toolbar: '#opeBar'}
            ]]
            ,done: function (res, curr, count) {
                $('.img-circle').viewer({
                    url: 'data-original',
                });
            }
        });
    });
</script>
</body>
</html>